package net.hn.hnms.biz.project.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.hn.hnms.biz.project.domain.ContractInvoicePayment;
import net.hn.hnms.biz.project.request.ContractInvoiceReq;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface ContractInvoicePaymentMapper extends BaseMapper<ContractInvoicePayment> {

    @Update("<script>" +
            " update contract_invoice_payment set  payment_id = #{data.contractPaymentId} " +
            " where invoice_id = #{data.contractInvoiceId}" +
            "</script>")
    void updateContractInvoicePayment(@Param("data") ContractInvoiceReq data);

    @Update("<script>" +
            " update contract_invoice_payment set  invoice_id = #{data.invoiceId} " +
            " where payment_id = #{data.paymentId}" +
            "</script>")
    void updateContractInvoicePaymentByInvoice(@Param("data") ContractInvoicePayment data);
}
